package com.thread.practice;

public class ThreadDemo {

	public static void main(String[] args) {
		new NewThread();
		for (int i = 0; i < 10; i++) {
			System.out.println("Main Thread" + i);
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				// 如果其他线程试图中断这个正在休眠的线程就会抛出这个异常
				System.out.println("Main Thread Interrupted");
			}
		}
		System.out.println("主线程关闭");
	}

}
